def count(string, letter):
    c = 0
    for l in string:
        if l == letter:
            c += 1

    return c


print(count('yinchao', 'y'))  # 1
